#!/bin/bash

# architecture prefix
ARCH="arm-linux"

# path to the toolchain and kernel base
TOOL_PATH=/usr/local/arm

# path to the toolchain base
BASE_PATH=$TOOL_PATH/2.95.3

# cumulative toolchain prefix
PREFIX=$BASE_PATH/bin/$ARCH

export CC=$PREFIX-gcc
export CXX=$PREFIX-g++
export LD=$PREFIX-ld
export NM="$PREFIX-nm -B"
export AR=$PREFIX-ar
export RANLIB=$PREFIX-ranlib
export STRIP=$PREFIX-strip
export OBJCOPY=$PREFIX-objcopy
export LN_S="ln -s"

export CFLAGS="-Wall -O3 -funroll-loops -I$BASE_PATH/include"
export CPPFLAGS="-I$BASE_PATH/include"
export CXXFLAGS=""

export LDFLAGS="-L$BASE_PATH/lib -L$BASE_PATH/$ARCH/lib -L$BASE_PATH/lib/gcc-lib/arm-linux/2.95.3"

./configure --host=$ARCH --prefix=$BASE_PATH
